package com.zmc.common.utils;

/**
 * @Author：zmc
 * @Date：2024/11/12 23:03
 */
public class RegularValidUtils {

    public static final String VALID_PHONE = "^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$";

    public static final String VALID_PHONE_CODE = "^\\d{6}$";

    public static boolean checkPhone(String phone) {
        return phone.matches(VALID_PHONE);
    }

    public static boolean checkPhoneCode(String code) {
        return code.matches(VALID_PHONE_CODE);
    }

    public static void main(String[] args) {
        System.out.println(checkPhoneCode("666666"));
    }

}
